<template>
  <Broadcast ref="broadcast" />
</template>

<script>
import { ref, onMounted } from "vue";
import Broadcast from "./components/Broadcast.vue";

export default {
  name: "App",
  components: {
    Broadcast,
  },
  setup() {
    const broadcast = ref(null);

    onMounted(() => {
      document.onkeydown = () => {
        if (window.event.keyCode == 13 || window.event.keyCode == 27) {
          window.event.preventDefault(); //关闭浏览器快捷键
          broadcast.value.fullscreen();
        }
      };
    });

    return {
      broadcast,
    };
  },
};
</script>
